package com.hoshiicloud.common.constant;


/**
 * 配送状态
 * 0，未发货；1，已发货 2-部分发货   3，已收货；4 部分收货 5 ，备货中
 */
public enum  ShippingStatusEnum {

    // 商品配送情况 0，未发货；1，已发货 2-部分发货   3，已收货；4 部分收货 5 ，备货中
    UN_SHIPPED(0, "未发货"),
    HAS_SHIPPED(1, "已发货"),
    PART_SHIPPED(2, "部分发货"),
    HAS_RECEIVED(3, "已收货"),
    PART_RECEIVED(4, "部分收货"),
    STOCKING_UP(5, "备货中");

    private int code;

    private String name;

    ShippingStatusEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int getCode() {
        return this.code;
    }

    public String getName() {
        return this.name;
    }

    public static ShippingStatusEnum get(int code) {
        for (ShippingStatusEnum aparameterStatus : values()) {
            if (aparameterStatus.getCode() == code) {
                return aparameterStatus;
            }
        }
        return null;
    }
}
